<template>
  <div id="root">
  <el-dropdown placement="right" @command="ChangeToLogin">
    <img class="changeToAntherLogin el-dropdown-link" src="../assets/切换卡片.png"/>
    <el-dropdown-menu slot="dropdown" >
      <el-dropdown-item command="./Login_old">旧版本</el-dropdown-item>
      <el-dropdown-item command="./Login_old" disabled>测试版</el-dropdown-item>
      <el-dropdown-item command="./Login_CaoMengYao" >曹梦瑶</el-dropdown-item>
      <el-dropdown-item command="./Login" >最新版</el-dropdown-item>
      <el-dropdown-item command="./Login_old" divided disabled>当前版本:{{msg}}</el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
  </div>
</template>

<script>
export default {
  name: "ChangeLogin",
  data(){
    return{
      msg:''
    }
  },
  methods:{
    ChangeToLogin(data){
      this.$router.push(data)
    }
  },
  mounted() {
    console.log(this.$route.path)
    if(this.$route.path=='/'||this.$route.path=='/Login'){
      this.msg='最新版'
    }
    if(this.$route.path=='/Login_old'){
      this.msg='旧版本'
    }
    if(this.$route.path=='/Login_CaoMengYao'){
      this.msg='曹梦瑶'
    }
  }
}
</script>

<style scoped>
#root{
  position: fixed;
  z-index: 1;
  top:4%;
  left:4%;
  width: 100px;
  height:50px !important;
  background-color: transparent;
}
img{
  width: 40px;
}
</style>